Xbasic

API_GETENVIRONMENTVAR Function

Syntax

String as C = api_getenvironmentvar(C system_var )

Arguments

String

The value of the variable.

system_var

The name of a Windows environmental variable.

Description

The API_GETENVIRONMENTVAR() returns the value of a Windows environment variable.

Example

? api_getenvironmentvar("windir")
= "C:\WINDOWS"
? api_getenvironmentvar("path")
=
"c:\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\PROGRA~1\
COMMON~1\Odbc\FILEMA~1;C:\Program Files\Symantec\pcAnywhere\;C:\Program
Files\Resource Kit\;C:\Program Files\Common Files\Adaptec
Shared\System;c:\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program
Files\Microsoft Visual Studio\Common\Tools\WinNT;C:\Program Files\Microsoft
Visual Studio\Common\MSDev98\Bin;C:\Program Files\Microsoft Visual
Studio\Common\Tools;C:\Program Files\Microsoft Visual
Studio\VC98\bin;;C:\Program Files\A5V4"
? api_getenvironmentvar("nosuchvar")
= ""

Limitations

Desktop applications only.

See Also